package com.woniuxy.charin.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.charin.model.entity.ChargingRecords;
import com.woniuxy.charin.model.vo.ChargingRecordsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
* @author Administrator
* @description 针对表【charging_records】的数据库操作Mapper
* @createDate 2024-12-30 15:23:09
* @Entity com.woniuxy.model.entity.ChargingRecords
*/
public interface ChargingRecordsMapper extends BaseMapper<ChargingRecords> {


    Page<ChargingRecordsVo> selectChargingRecords(@Param("page") Page<ChargingRecordsVo> page,
                                                  @Param("queryParams") Map<String, Object> queryParams);


    ChargingRecordsVo findChargingRecordVoById(@Param("id") Long id);

    /**
     * 更新退款信息
     */
    int updateRefundInfo(ChargingRecords chargingRecord);

    /**
     * 更新退款相关信息
     */
    int updateRefundInfo1(ChargingRecords record);

    /**
     * 根据订单号查询充电记录
     */
    ChargingRecords findByOrderNumber(@Param("orderNumber") String orderNumber);


//    @Select("SELECT cr.order_number AS orderNumber, cp.pile_power AS pilePower, sfs.electric_fee AS electricFee, cr.create_time AS createTime " +
//            "FROM charging_records cr " +
//            "LEFT JOIN charging_pile cp ON cr.pile_id = cp.id " +
//            "LEFT JOIN station_fee_standard sfs ON cr.station_id = sfs.station_id " +
//            "WHERE cr.order_number = #{orderNumber}")
//    ChargingStatusDto selectChargingStatusByOrderNumber(@Param("orderNumber") String orderNumber);

}




